package com.redteam.data.beans;

import com.redteam.interfaces.Employee;
import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

/**
 * A java bean for instructor
 * @author Teddy Karam
 */
public class Instructor extends Pilot implements Employee, Serializable {

    private List<Student> student;
    private static final long serialVersionUID = 1L;

    /**
     * Full <code>Instructor</code> constructor
     * @param id
     * @param firstName
     * @param middleName
     * @param lastName
     * @param street
     * @param city
     * @param state
     * @param zipCode
     * @param email
     * @param fBOId
     * @param birthdate
     * @param homePhone
     * @param cellPhone
     * @param workPhone
     * @param gender
     * @param flightHours
     * @param type
     * @param userName
     * @param password
     */
    public Instructor(long id, String firstName, String middleName, String lastName, String street, String city, String state, String zipCode, String email, long fBOId, Date birthdate, String homePhone, String cellPhone, String workPhone, String gender, int flightHours, String type, String userName, String password) {
        super(id, firstName, middleName, lastName, street, city, state, zipCode, email, fBOId, birthdate, homePhone, cellPhone, workPhone, gender, flightHours, type, userName, password);
        student = new ArrayList<Student>();
    }

    /**
     * Default constructor
     */
    public Instructor() {
        super();
        student = new ArrayList<Student>();
    }

    /**
     * Returns a list of students associated with this instructor
     * @return the Student
     */
    public List<Student> getStudent() {
        return student;
    }

    /**
     * Sets the list of students associated with this instructor
     * @param students
     */
    public void setStudent(List<Student> students) {
        this.student.addAll(students);
    }

    /**
     * @inheritDoc
     */
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Instructor other = (Instructor) obj;
        if (this.student != other.student && (this.student == null || !this.student.equals(other.student))) {
            return false;
        }
        return true;
    }

    /**
     * @inheritDoc
     */
    @Override
    public int hashCode() {
        int hash = 3;
        hash = 73 * hash + (this.student != null ? this.student.hashCode() : 0);
        return hash;
    }
}
